<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">

        <h1> {{ date | dateFilter }}</h1>
    </div>
    <script src="vue.js"></script>
    <script src="./node_modules/moment/moment.js"></script>
    <script>
        Vue.filter('dateFilter',res=>{
            // return `${ res.getFullYear()}-${res.getMonth()+1}-${res.getDate()}`
            // return `${res.getFullYear()}-${res.getMonth()+1}-${res.getDate()}`
            return moment(res).format('YYYY-MM-DD|HH:mm:ss')
        })
        const vm=new Vue({
            el:"#app",
            data:{
                date:new Date()
            },
        })
    </script>
</body>
</html>